home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / ASSEMBLE / H145.ZIP / ASXXXX_4.ZIP / T6809E.ASM < prev    next >
Assembly Source File  |  1990-07-18  |  2KB  |  143 lines

  1.     .title    6809 Error Tests
  2.  
  3.     ;a   errors reported at assembly time
  4.     ;*L  errors reported at LINK time
  5.     ;
  6.     ;ASLINK -C
  7.     ;-XMS
  8.     ;T6809E
  9.     ;-B DATA = 0x100
  10.     ;-B ROM  = 0x400
  11.     ;-E
  12.     ;
  13.  
  14.     .blkb    0d256        ;.area _CODE
  15.  
  16.     .area    DATA
  17.  
  18.     .globl    dat0,dat255,dat256
  19.  
  20. dat0:    .byte    4
  21.     .blkb    254
  22. dat255:    .byte    5
  23. dat256:    .byte    6
  24.  
  25.     .area    ROM
  26.  
  27.     .globl    rom0,rom255,rom256
  28.  
  29. rom0:    .byte    1
  30.     .blkb    254
  31. rom255:    .byte    2
  32. rom256:    .byte    3
  33.  
  34.     .sbttl    S_ACC Tests
  35.  
  36.     .area    PROGRAM
  37.  
  38.     .setdp    0,_CODE
  39.  
  40.     mmnn    =    0x2233
  41.  
  42.     adda    #0x01        ;   8b 01
  43.     adda    *0x02        ;   9b 02
  44.     adda    mmnn        ;   bb 22 33
  45.     adda    ,x        ;   ab 84
  46.     adda    [mmnn]        ;   ab 9f 22 33
  47.  
  48.     addb    #0x01        ;   cb 01
  49.     addb    *0x02        ;   db 02
  50.     addb    mmnn        ;   fb 22 33
  51.     addb    ,x        ;   eb 84
  52.     addb    [mmnn]        ;   eb 9f 22 33
  53.  
  54.  
  55.     .sbttl    S_SOP Tests
  56.  
  57.     clr    #0x01        ;a
  58.     clr    *0x02        ;   0f 02
  59.     clr    mmnn        ;   7f 22 33
  60.     clr    ,x        ;   6f 84
  61.     clr    [mmnn]        ;   6f 9f 22 33
  62.  
  63.  
  64.     .sbttl    S_LR Tests
  65.  
  66.     cmpx    #0x01        ;   8c 00 01
  67.     cmpx    *0x02        ;   9c 02
  68.     cmpx    mmnn        ;   bc 22 33
  69.     cmpx    ,x        ;   ac 84
  70.     cmpx    [mmnn]        ;   ac 9f 22 33
  71.  
  72.  
  73.     .sbttl    S_STR Tests
  74.  
  75.     stx    #0x01        ;a
  76.     stx    *0x02        ;   9f 02
  77.     stx    mmnn        ;   bf 22 33
  78.     stx    ,x        ;   af 84
  79.     stx    [mmnn]        ;   af 9f 22 33
  80.  
  81.  
  82.     .sbttl    S_LEA Tests
  83.  
  84.     leax    #0x01        ;a
  85.     leax    *0x02        ;a
  86.     leax    mmnn        ;a
  87.     leax    ,x        ;   30 84
  88.     leax    [mmnn]        ;   30 9f 22 33
  89.  
  90.  
  91.     .page
  92.     .sbttl    Direct Addressing Tests
  93.  
  94.     ;*L == Error reported at LINK time !!!
  95.  
  96.     neg    *0x20        ;00 20
  97.  
  98.     .setdp    0,ROM
  99.  
  100.     neg    *rom0        ;   00 00
  101.     neg    *rom255        ;   00 ff
  102.  
  103.     neg    *rom256        ;*L 00 00
  104.     neg    *dat0        ;*L 00 00
  105.     neg    *dat255        ;*L 00 ff
  106.     neg    *dat256        ;*L 00 00
  107.  
  108.     .setdp    0,DATA
  109.  
  110.     neg    *rom0        ;*L 00 00
  111.     neg    *rom255        ;*L 00 ff
  112.     neg    *rom256        ;*L 00 00
  113.  
  114.     neg    *dat0        ;   00 00
  115.     neg    *dat255        ;   00 ff
  116.     neg    *dat256        ;*L 00 00
  117.  
  118.     .setdp    0,_CODE
  119.  
  120.     neg    *rom0        ;*L 00 00
  121.     neg    *rom255        ;*L 00 ff
  122.     neg    *rom256        ;*L 00 00
  123.  
  124.     neg    *dat0        ;*L 00 00
  125.     neg    *dat255        ;*L 00 ff
  126.     neg    *dat256        ;*L 00 00
  127.  
  128.  
  129.     .sbttl    PC and PCR mode checks
  130.  
  131.     .globl    extern
  132.  
  133.     num    =    0x7f
  134.     ext    =    0x80
  135.  
  136.     adda    0x17,pc        ;   ab 8c 17
  137.     neg    num,pc        ;   60 8c 7f
  138.     tst    ext,pc        ;   6d 8d 00 80
  139.     tst    ext,pcr        ;   6d 8c (0x80 - . - 3)
  140.     adda    a0,pc        ;a
  141.     neg    extern,pc    ;a
  142. a0:
  143.